package P1055;
import java.util.Objects;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ISBNstring = sc.next();
        char[] ISBN = new char[13], end = new char[]{'0','1','2','3','4','5','6','7','8','9','X'};
        char endNum;
        int sum =0;
        for (int i = 0,j=1;i<13;++i){
            ISBN[i] = ISBNstring.charAt(i);
            if ( i == 1 ||  i == 5 ||  i == 12 || i == 11){
                continue;
            }
            sum += (ISBN[i]-'0')*j;
            ++j;
        }
        sum %= 11;
        endNum = end[sum];
        if (Objects.equals(endNum, ISBN[12])) System.out.println("Right");
        else {
            System.out.println(ISBNstring.substring(0,12)+endNum);
        }
    }
}
